<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="box"></div>

    <script>
        var box = document.getElementById("box");

        box.setAttribute("style", "width: 200px; height: 200px; background-color: red;");

        box.style.width = "300px";
        box.style.height = "300px";
        box.style.backgroundColor = "blue";

        box.style.cssText = "width: 400px; height: 400px; background-color: green;";

    </script>
</body>
</html>